<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript" src="<c:url value='/js/plug/area/load_area.js'/>"></script>


<div id="cc_buyers" class="easyui-layout" style="width:100%;height:100%;" fit="true">
	<div data-options="region:'north',title:'日志查询',split:true" style="height:70px;background-color:#e6edfd;">
    	<form action="" id="searchForm" name="searchForm">
    	<table class="screen">
			<tr>
			    <td class="screen-n"><span>内容</span></td>
				<td class="screen-n">
					<input type="text" id="s_message" class="screen-input" style="width:200px" onkeydown="pms.kd13('initSaleDetail')">
				</td>
				
				<td class="screen-n"><span>日志时间</span></td>
				<td class="screen-n">
					<input type="text" id="startDate" class="screen-input easyui-datebox" onkeydown="pms.kd13('initSaleDetail')">
				</td>
				<td class="screen-n"><span>至</span></td>
				<td class="screen-n">
					<input type="text" id="endDate" class="screen-input easyui-datebox" onkeydown="pms.kd13('initSaleDetail')">
				</td>
				<td class="screen-n">
					<input type="button" class="button" value="查询" onclick="initSaleDetail()">
					<input type="button" class="button" value="重置" onclick="pms.resetForm('searchForm')" >
				    <input type="button" class="button" value="导出" onclick="loadExecl('initStoreOutCheckTableExcel')" >
				</td>
			</tr>
		</table>
		</form>
    </div>
    <div data-options="region:'center',split:true" style="width: 100%;height: 100%">
		<table id="tableGrid"></table>
	</div>
</div>  
<script>
var toolbar = [];
var saleDetailTable;
$(function(){
	initSaleDetail();
});
function getParams(){
	var queryParamss = {
			"message":$('#s_message').val(),
			"startDate":$("#startDate").datebox("getValue"),
			 "endDate":$("#endDate").datebox("getValue")
	    };
    return queryParamss;
}
function initSaleDetail(){
	saleDetailTable = $('#tableGrid').pDataGrid({
		toolbar:toolbar,
		columns:[[
				   {field:'ck',checkbox:true},
	               {field:'createDate',title:'日志时间',align:'center',width:130,sortable:true},
	               {field:'message',title:'内容',align:'center'}
		          ]],
		    url:'<c:url value="/log/searchPageEmBLog.do"/>',  
		    pagination:true,
		    pageSize:30,
		    fitColumns:false,
		    singleSelect:false,
		    queryParams:getParams(),
			completeCallback:function(data){
			},
			onLoadSuccess : function(data) {
				var panel = $(this).datagrid('getPanel');
				var tr = panel.find('div.datagrid-body tr');
				tr.each(function() {
					var td = $(this).children('td[field="message"]');
					td.children("div").css({
						"text-align" : "left"
					});
				});
			}
	}); 
}

//导出
function initStoreOutCheckTableExcel(){
	loadExcelCallBack('<c:url value="/log/searchPageEmBLogExcel.do"/>',getParams());
} 	
</script>
